package com.adpter;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.modle.IFriend;

public class FriendAdapter extends BaseAdapter {
	ArrayList<IFriend> dataList ;
	Context context;
	LayoutInflater inflater;

	public FriendAdapter(ArrayList<IFriend> dataList,Context context) {
		super();
		this.context = context;
		this.dataList = dataList;
		this.inflater=LayoutInflater.from(context);
	}

	@Override
	public int getCount() {
		return dataList.size();
	}

	@Override
	public Object getItem(int position) {
		return dataList.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}
	
	@Override
	public boolean isEnabled(int position) {
		return dataList.get(position).isClickable();
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		return dataList.get(position).getView(context, convertView,inflater );
	}
}